package zhizhemodi.tech.short_term_bwork.tool;

import java.sql.Timestamp;

import org.springframework.core.convert.converter.Converter;

public class DateConverter implements Converter<String, Timestamp> {
    // private final SimpleDateFormat smf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    @Override
    public Timestamp convert(String s) {
        if("".equals(s) || null == s) {
            return null;
        }

        try {
            return Timestamp.valueOf(s);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
